package net.wofly.cashier.preorder.service.impl;

import java.util.List;

import javax.transaction.Transactional;

import net.wofly.cashier.preorder.domain.BookMealContent;
import net.wofly.cashier.preorder.repository.BookMealContentRepository;
import net.wofly.cashier.preorder.service.IBookMealContentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("iBookMealContentService")
@Transactional
public class BookMealContentServiceImpl implements IBookMealContentService {

	@Autowired
	BookMealContentRepository bookMealContentRepository;

	@Override
	public BookMealContent save(BookMealContent entity) {
		return bookMealContentRepository.save(entity);
	}

	@Override
	public void delete(BookMealContent entity) {
		bookMealContentRepository.delete(entity);
	}

	@Override
	public void delete(String key) {
		bookMealContentRepository.delete(key);
	}

	@Override
	public BookMealContent findOne(String key) {
		return bookMealContentRepository.findOne(key);
	}

	@Override
	public List<BookMealContent> save(List<BookMealContent> entityList) {
		return (List<BookMealContent>) bookMealContentRepository.save(entityList);
	}

	@Override
	public List<BookMealContent> findByBookMealID(String bookMealID) {
		return bookMealContentRepository.findByBookMealID(bookMealID);
	}
}
